home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak 66
/
Vol 66.iso
/
games
/
bob_espo.swf
/
scripts
/
__Packages
/
CheatPopUp.as
< prev
next >
Wrap
Text File
|
2013-04-24
|
3KB
|
69 lines
class CheatPopUp extends PopUp
{
static var nMAX_LENGTH_CODE = 22;
static var sCODE_CHARS_ALLOWED = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 _!?.";
static var sSTATE_CHEAT_OUTFITS = "Outfits";
static var sSTATE_CHEAT_BADCODE = "BadCode";
static var sSTATE_CHEAT_EMPTY = "Empty";
function CheatPopUp(_mcRef)
{
super(_mcRef);
}
function doShow()
{
if(this.sState == PopUp.sSTATE_IDLE)
{
this.setState(PopUp.sSTATE_OPENING);
this.nCount = 0;
this.mcRef.mcState.mcPanel.mcResult.gotoAndStop(CheatPopUp.sSTATE_CHEAT_EMPTY);
}
}
function doHide()
{
if(this.sState == PopUp.sSTATE_OPENED)
{
var _loc2_ = this.mcRef.mcState.mcPanel.mcResult._currentframe;
var _loc3_ = this.mcRef.mcState.mcPanel.txtCheat.text;
this.setState(PopUp.sSTATE_CLOSING);
this.mcRef.mcState.mcPanel.mcResult.gotoAndStop(_loc2_);
this.mcRef.mcState.mcPanel.txtCheat.text = _loc3_;
}
}
function clickCancelButton()
{
Controller.getRef().playClickSound();
this.doHide();
}
function clickEnterButton()
{
Controller.getRef().playClickSound();
if(this.mcRef.mcState.mcPanel.txtCheat.text == LD.sCHEAT_CLOTHING)
{
this.mcRef.mcState.mcPanel.mcResult.gotoAndStop(CheatPopUp.sSTATE_CHEAT_OUTFITS);
Main.getRef().setCheatClothes(true);
}
else
{
this.mcRef.mcState.mcPanel.mcResult.gotoAndStop(CheatPopUp.sSTATE_CHEAT_BADCODE);
}
Selection.setFocus(this.mcRef.mcState.mcPanel.txtCheat);
}
function manageChange()
{
this.mcRef.mcState.mcPanel.mcResult.gotoAndStop(CheatPopUp.sSTATE_CHEAT_EMPTY);
}
function initPopUp()
{
this.mcRef.mcState.mcPanel.btnCancel.onRollOver = Delegate.create(Main.getRef(),Main.getRef().rollOverButton);
this.mcRef.mcState.mcPanel.btnCancel.onRelease = Delegate.create(this,this.clickCancelButton);
this.mcRef.mcState.mcPanel.btnEnter.onRollOver = Delegate.create(Main.getRef(),Main.getRef().rollOverButton);
this.mcRef.mcState.mcPanel.btnEnter.onRelease = Delegate.create(this,this.clickEnterButton);
this.mcRef.mcState.mcPanel.txtCheat.tabIndex = 101;
this.mcRef.mcState.mcPanel.txtCheat.maxChars = CheatPopUp.nMAX_LENGTH_CODE;
this.mcRef.mcState.mcPanel.txtCheat.restrict = CheatPopUp.sCODE_CHARS_ALLOWED;
this.mcRef.mcState.mcPanel.txtCheat.onChanged = Delegate.create(this,this.manageChange);
Selection.setFocus(this.mcRef.mcState.mcPanel.txtCheat);
this.mcRef.mcState.mcPanel.mcResult.gotoAndStop(CheatPopUp.sSTATE_CHEAT_EMPTY);
}
}